﻿using System.Collections.Generic;

namespace SharpTag.ID3
{
    /// <summary>
    /// Interface representing a Frame found in an ID3v2 Tag.
    /// </summary>
    public interface IFrame : IPreparable, IModifiable, ICompressable
    {
        /// <summary>
        /// Gets the <see cref="IFrameHeader"/> of the Frame.
        /// </summary>
        IFrameHeader Header
        {
            get;
        }

        /// <summary>
        /// Gets the list of Key Value Pairs representing the data fields in the Frame.
        /// </summary>
        List<KeyValuePair<string, object>> Data
        {
            get;
        }

        /// <summary>
        /// Adds a Data Field to the Frame.
        /// </summary>
        /// <param name="keyName">Name of the data field.</param>
        /// <param name="data">Value of the data field.</param>
        void AddDataField(string keyName, object data);

        /// <summary>
        /// Removes a Data Field from the Frame.
        /// </summary>
        /// <param name="fieldName">Name of the field to remove.</param>
        void RemoveDataField(string fieldName);

        /// <summary>
        /// Changes the value of a specified Data Field in the Frame.
        /// </summary>
        /// <param name="fieldName">Name of the field that has the value to change.</param>
        /// <param name="fieldValue">Value to assign to the specified field.</param>
        void SetDataField(string fieldName, object fieldValue);

        /// <summary>
        /// Parses the raw Frame data into the appropriate properties.
        /// </summary>
        /// <param name="frameBytes">A byte array containing the raw frame data.</param>
        void ParseFrameData(byte[] frameBytes);
    }
}
